:root {
    --theme-color: #42b983;
    --sidebar-width: 280px;
    --heading-color: #2c3e50;
    --text-color: #34495e;
    --text-muted: #7f8c8d;
    --border-color: #eaecef;
    --background-color: #ffffff;
    --sidebar-bg: #f8f9fa;
    --code-bg: #f6f8fa;
    --highlight-bg: #e8f4fd;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
}

.header {
    background-color: var(--background-color);
    color: var(--heading-color);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

.header h1 {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
    color: var(--theme-color);
}

.menu-toggle {
    background: var(--sidebar-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.menu-toggle:hover {
    background: var(--highlight-bg);
    border-color: var(--theme-color);
}

.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    width: 100%;
    padding-bottom: 0;
}

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    transition: transform 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    flex-shrink: 0;
    overflow: hidden;
}

.sidebar.hidden {
    transform: translateX(-100%);
    position: absolute;
    height: 100%;
    z-index: 100;
}

.content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: var(--background-color);
}

.api-content {
    background-color: var(--background-color);
    min-height: 100%;
}

.footer {
    text-align: center;
    padding: 10px;
    color: var(--text-muted);
    font-size: 12px;
    background-color: var(--background-color);
    border-top: 1px solid var(--border-color);
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    color: var(--text-muted);
}

.loading::after {
    content: '';
    width: 30px;
    height: 30px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--theme-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-top: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 菜单样式 */
.module-group {
    border-bottom: 1px solid var(--border-color);
}

.module-header {
    padding: 12px 15px;
    cursor: pointer;
    font-weight: 500;
    color: var(--heading-color);
    background-color: var(--sidebar-bg);
    transition: background-color 0.2s;
    position: relative;
}

.module-header:hover {
    background-color: var(--highlight-bg);
    color: var(--theme-color);
}

.api-type-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}

.api-type-tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
}

.api-type-tab.active {
    background-color: var(--background-color);
    color: var(--theme-color);
    border-bottom: 2px solid var(--theme-color);
}

.module-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 10px 15px 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

.menu-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

.module-group {
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

/* 确保侧边栏内的内容可以完全展开 */
.sidebar {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.menu-item {
    padding: 8px 15px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    font-size: 14px;
    color: var(--text-color);
    border-left: 2px solid transparent;
}

.menu-item:hover {
    background-color: var(--highlight-bg);
    color: var(--theme-color);
}

.menu-item.active {
    background-color: var(--highlight-bg);
    color: var(--theme-color);
    border-left-color: var(--theme-color);
}

.menu-item.level-2 {
    padding-left: 30px;
    font-size: 13px;
    color: var(--text-muted);
}

.expand-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.3s;
    font-size: 10px;
}

.expand-icon.expanded {
    transform: translateY(-50%) rotate(90deg);
}

/* API详情样式 */
.api-header {
    margin-bottom: 20px;
}

.api-name {
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--heading-color);
}

.api-path-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
}

.api-path {
    font-size: 14px;
    color: var(--theme-color);
    background-color: var(--code-bg);
    padding: 8px 12px;
    border-radius: 4px;
    word-break: break-all;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
}

.api-description {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 15px;
    font-size: 14px;
}

.section-title {
    font-size: 16px;
    font-weight: 500;
    margin: 24px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    color: var(--heading-color);
}

.method-section {
    margin: 15px 0;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--background-color);
}

.method-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.method-type {
    padding: 3px 8px;
    border-radius: 3px;
    color: white;
    font-size: 11px;
    font-weight: 600;
    margin-right: 8px;
    min-width: 50px;
    text-align: center;
}

.method-type.GET {
    background-color: #61affe;
}

.method-type.POST {
    background-color: #49cc90;
}

.method-type.PUT {
    background-color: #fca130;
}

.method-type.DELETE {
    background-color: #f93e3e;
}

.method-type.OTHER {
    background-color: #9013fe;
}

.method-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--heading-color);
}

.method-description {
    color: var(--text-muted);
    margin-bottom: 10px;
    font-size: 13px;
}

/* 表格样式 */
.api-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 14px;
}

.api-table th,
.api-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.api-table th {
    background-color: var(--sidebar-bg);
    font-weight: 500;
    color: var(--text-color);
    font-size: 13px;
}

.api-table tr:hover {
    background-color: var(--highlight-bg);
}

/* 统计信息 */
.stats-info {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stat-item {
    background-color: var(--sidebar-bg);
    padding: 10px 15px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 100px;
    transition: transform 0.2s;
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.stat-number {
    font-size: 22px;
    font-weight: 600;
    color: var(--theme-color);
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 3px;
}

/* 分享链接样式 */
.share-section {
    background-color: rgba(0, 0, 0, 0.02);
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 6px;
    position: relative;
}

.share-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.share-link {
    flex: 1;
    min-width: 200px;
    padding: 6px 10px;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: monospace;
    font-size: 13px;
    color: var(--text-color);
    word-break: break-all;
}

.share-tooltip {
    position: absolute;
    top: 100%;
    right: 20px;
    background-color: var(--theme-color);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 10;
}

.share-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    right: 10px;
    border: 6px solid transparent;
    border-bottom-color: var(--theme-color);
}

.btn-sm {
    padding: 4px 12px;
    font-size: 12px;
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-color-light);
}

.empty-state h3 {
    margin-bottom: 10px;
    color: var(--heading-color);
    font-size: 18px;
}

/* 页脚样式 */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--sidebar-bg);
    padding: 10px 20px;
    text-align: center;
    border-top: 1px solid var(--border-color);
    z-index: 100;
    height: 40px;
}

.footer p {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 20px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        width: 250px;
    }
    
    .content {
        padding: 15px;
    }
    
    .stats-info {
        flex-direction: column;
        align-items: center;
    }
    
    .stat-item {
        min-width: 200px;
    }
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--sidebar-bg);
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* 表单样式 */
.api-form {
    background-color: var(--code-bg);
    padding: 15px;
    border-radius: 4px;
    margin: 15px 0;
}

.form-group {
    margin-bottom: 12px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--heading-color);
}

.form-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: var(--theme-color);
}

.form-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    font-size: 14px;
    min-height: 100px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
    resize: vertical;
    transition: border-color 0.3s;
}

.form-textarea:focus {
    outline: none;
    border-color: var(--theme-color);
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 3px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.btn-primary {
    background-color: var(--theme-color);
    color: white;
}

.btn-primary:hover {
    background-color: #3aa574;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-success {
    background-color: #28a745;
    color: white;
}

/* 响应展示样式 */
.response-container {
    margin-top: 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.response-header {
    background-color: var(--sidebar-bg);
    padding: 10px 15px;
    font-size: 13px;
    font-weight: 500;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.response-content {
    padding: 15px;
    background-color: var(--background-color);
    max-height: 400px;
    overflow-y: auto;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
    font-size: 13px;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Curl命令样式 */
.curl-command {
    background-color: var(--code-bg);
    padding: 12px;
    border-radius: 4px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
    font-size: 12px;
    margin: 10px 0;
    position: relative;
    word-break: break-all;
}

.copy-btn {
    padding: 4px 10px;
    font-size: 11px;
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.copy-btn:hover {
    background-color: var(--highlight-bg);
    border-color: var(--theme-color);
    color: var(--theme-color);
}

/* API Tab样式 - 更符合标签页类型设计 */
.api-tabs {
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
}

.api-tab-nav {
    display: flex;
    background-color: var(--background-color);
    padding: 0 10px;
    margin-bottom: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.api-tab-btn {
    padding: 12px 24px;
    border: 1px solid transparent;
    background-color: transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
    margin: 8px 2px;
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
}

.api-tab-btn:hover {
    color: var(--theme-color);
    background-color: var(--hover-bg);
}

.api-tab-btn.active {
    color: var(--theme-color);
    background-color: white;
    border-color: var(--border-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    font-weight: 600;
}

.api-tab-content {
    padding: 20px;
    background-color: white;
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 8px 8px;
    min-height: 300px;
}

/* 为不同容器中的复制按钮添加特定样式 */
.curl-command {
    position: relative;
    padding-right: 60px; /* 为右上角的复制按钮留出空间 */
}

.curl-command .copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
}

.response-header .copy-btn {
    flex-shrink: 0;
    margin-left: 10px;
}

.form-actions .copy-btn {
    margin-left: auto;
}